home *** CD-ROM | disk | FTP | other *** search
Oberon Document | 1996-01-05 | 3.8 KB | 113 lines | [oODC/obnF] |
- Documents.StdDocumentDesc
- Documents.DocumentDesc
- Containers.ViewDesc
- Views.ViewDesc
- Stores.StoreDesc
- Documents.ModelDesc
- Containers.ModelDesc
- Models.ModelDesc
- Stores.ElemDesc
- TextViews.StdViewDesc
- TextViews.ViewDesc
- TextModels.StdModelDesc
- TextModels.ModelDesc
- TextModels.AttributesDesc
- Helvetica
- Helvetica
- Helvetica
- MODULE ObxDialog;
- IMPORT Dialog;
- TYPE
- Enumeration* = RECORD (Dialog.Enumeration) END;
- Selection* = RECORD (Dialog.Selection) END;
- Combo* = RECORD (Dialog.Combo) END;
- dialog*: RECORD (Dialog.Interactor)
- list*: Enumeration;
- sel*: Selection;
- combo*: Combo;
- sum-: LONGINT;
- disable*: BOOLEAN;
- elems*: INTEGER;
- A*, B*: PROCEDURE;
- END;
- PROCEDURE NumToString (i: LONGINT; VAR str: Dialog.String);
- BEGIN
- CASE i OF
- | 0: str := "zero"
- | 1: str := "one"
- | 2: str := "two"
- | 3: str := "three"
- | 4: str := "four"
- | 5: str := "five"
- | 6: str := "six"
- | 7: str := "seven"
- | 8: str := "eight"
- | 9: str := "nine"
- | 10: str := "ten"
- | 11: str := "eleven"
- END
- END NumToString;
- PROCEDURE (VAR e: Enumeration) GetName* (i: LONGINT; VAR name: Dialog.String);
- BEGIN
- IF (i >= 0) & (i < dialog.elems) THEN NumToString(i, name) ELSE name := "" END
- END GetName;
- PROCEDURE (VAR e: Selection) GetName* (i: LONGINT; VAR name: Dialog.String);
- BEGIN
- IF (i >= 0) & (i < 12) THEN NumToString(i, name) ELSE name := "" END
- END GetName;
- PROCEDURE (VAR e: Combo) GetName* (i: LONGINT; VAR name: Dialog.String);
- BEGIN
- IF (i >= 0) & (i < 12) THEN NumToString(i, name) ELSE name := "" END
- END GetName;
- PROCEDURE SelNotify* (op, from, to: LONGINT);
- (* op = changed set element *)
- BEGIN
- IF op = Dialog.set THEN
- dialog.sum := (to - from + 1) * (to + from) DIV 2
- ELSIF op = Dialog.excluded THEN
- WHILE from <= to DO DEC(dialog.sum, from); INC(from) END
- ELSIF op = Dialog.included THEN
- WHILE from <= to DO INC(dialog.sum, from); INC(from) END
- END;
- Dialog.Update(dialog); Dialog.CheckGuards (* show new dialog.sum *)
- END SelNotify;
- PROCEDURE DisableNotify* (op, from, to: LONGINT);
- BEGIN
- IF op = Dialog.changed THEN Dialog.CheckGuards END (* reevaluate listbox guard *)
- END DisableNotify;
- PROCEDURE ElemsNotify* (op, from, to: LONGINT);
- BEGIN
- IF op = Dialog.changed THEN
- IF dialog.elems < 0 THEN dialog.elems := 0; Dialog.Update(dialog)
- ELSIF dialog.elems > 12 THEN dialog.elems := 12; Dialog.Update(dialog)
- END;
- Dialog.UpdateList(dialog.list) (* update list of listbox *)
- END;
- Dialog.CheckGuards
- END ElemsNotify;
- PROCEDURE ListGuard* (VAR par: Dialog.Par);
- BEGIN
- par.disabled := dialog.disable
- END ListGuard;
- PROCEDURE PressNotify* (op, from, to: LONGINT);
- BEGIN
- IF op = Dialog.pressed THEN Dialog.Beep END
- END PressNotify;
- PROCEDURE Dummy*;
- BEGIN (* empty command *)
- END Dummy;
- BEGIN
- dialog.A := Dummy; dialog.B := Dummy; dialog.elems := 6
- END ObxDialog.
- TextControllers.StdCtrlDesc
- TextControllers.ControllerDesc
- Containers.ControllerDesc
- Controllers.ControllerDesc
- TextRulers.StdRulerDesc
- TextRulers.RulerDesc
- TextRulers.StdStyleDesc
- TextRulers.StyleDesc
- TextRulers.AttributesDesc
- Helvetica
- Documents.ControllerDesc
-